<?php

namespace app\selladmin\model;

use think\Model;
use think\Db;

/*
 * 订单
 */

class Gallery extends Model {

    //查询店铺相册信息
    public function GalleryInfo($store_id) {
        if ($store_id) {
            $gallerywhere['store_id'] = $store_id;
        }
        $galleryList = Db::name('gallery')
                ->where($gallerywhere)
                ->field("id,type,store_id,name")
                ->order("add_time desc")
                ->select();
        for($i=0;$i<count($galleryList);$i++){
            $galleryList[$i]['img']=Db::name('photo')->where("gallery_id=".$galleryList[$i]['id'])->field('photo')->select();
        }
        return $galleryList;
    }

}
